﻿
Partial Class WebForm_ManageBanner
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            'Me.SearchRoom1.BindGV()
            '判斷是否有找到
            If DirectCast(Master.FindControl("lblHeadText"), Label) IsNot Nothing Then
                DirectCast(Master.FindControl("lblHeadText"), Label).Text = Me.GetLocalResourceObject("Title.Text")
            End If
        End If

        Me.Form.Enctype = "multipart/form-data"
    End Sub

    Protected Sub FormToolBar1_Searching(ByVal source As Object, ByVal e As System.EventArgs) Handles FormToolBar1.Searching
        Me.MultiView1.SetActiveView(Me.View1)
        Me.SearchBanner1.GridView1DataBind()
    End Sub

    Protected Sub FormToolBar1_Adding(ByVal source As Object, ByVal e As System.EventArgs) Handles FormToolBar1.Adding
        Me.MultiView1.SetActiveView(Me.View2)
        Me.AddBanner1.InitData(0)
    End Sub

    'GridView按下編輯
    Protected Sub SearchBanner1_GridView1SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles SearchBanner1.GridView1SelectedIndexChanged
        Me.MultiView1.SetActiveView(Me.View2)
        Me.AddBanner1.InitData(Me.SearchBanner1.GridView1SelectedValue)
    End Sub

    'SaveToolBar1存檔、取消
    Protected Sub AddBanner1_AfterSaveToolBar1Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddBanner1.AfterSaveToolBar1Click
        Me.MultiView1.SetActiveView(Me.View1)
        Me.SearchBanner1.GridView1DataBind()
    End Sub


End Class
